<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<title>企业列表</title>
<%@ include file="/pages/wx/baseHead.jsp"%>
<script type="text/javascript" src="${urlBasePath}js/jquery.cookie.js?v=<%=v %>"></script>
<!-- <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=2q9aXau4p4lTSfGWZNZmIv9D"></script>
<script type="text/javascript" src="http://developer.baidu.com/map/jsdemo/demo/convertor.js"></script> -->

<!-- #cb60b3 -->
 
<script type="text/javascript">
	
	
	$(function(){
		getPointH5(function(point){
			goPage(1);
		},false,false)
	});
	
	function applyOutCfm(relaId)
	{
		confirm("提示信息","确认退出该企业？",function(){
			var url ='${urlBasePath }weixin/user/companyJoinOut.do';
			$.ajax({
				url:url,
				data:{
					relaId:relaId
				},
				async:true,
				success:function(ret){
					if(ret.code == '0')
					{
						openToast("退出成功");
						setTimeout("goPage(1)",1000);
					}else
					{
						openDia('提示信息',"退出失败");
					}
				},
				error:function(){
					
				}
			});
			
		});
	}
	
</script>

</head>
<body>
<form action="${urlBasePath}weixin/user/companyList.do" id="theform" name="theform">	
<div class="bd">
    <div class="weui_panel weui_panel_access">
        <!-- <div class="weui_panel_hd" style="font-size: 1.2em;">已经加入的企业列表</div> -->
        <div class="weui_panel_bd">
        	<c:forEach var="obj" items="${objs.data }" varStatus="index">
	            <a href="javascript:void(0);" class="weui_media_box weui_media_appmsg form-inline">
	                <div class="weui_media_hd">
	                    <img class="weui_media_appmsg_thumb" style="width: 60px;height: 60px;border-radius:60px" src="${urlBasePath }images/qykd.png" alt="">
	                </div>
	                <div class="weui_media_bd">
	                    <h4 class="weui_media_title">商户：${obj.name }</h4>
	                    <p class="weui_media_desc">地址：${obj.address }</p>
	                    <p class="weui_media_desc">
	                    	状态：
	                    	<c:if test="${obj.valid == '00' }">
		                    	<c:choose>
		                    		<c:when test="${obj.state == '00' }">已通过</c:when>
		                    		<c:when test="${obj.state == '99' }">拒绝加入</c:when>
		                    		<c:when test="${obj.state == '01' }">待审核</c:when>
		                    		<c:when test="${obj.state == '02' }">已通过</c:when>
		                    		<c:otherwise>未知</c:otherwise>
		                    	</c:choose>
	                    	</c:if>
	                    	<c:if test="${obj.valid == '99' }">
	                    		已退出
	                    	</c:if>
	                    </p>
	                    <p class="weui_media_desc">距离：
	                    <c:choose>
	                    	<c:when test="${obj.distance >= 1 }">${obj.distance  }km</c:when>
	                    	<c:when test="${obj.distance <  1 }">${obj.distance*1000  }m</c:when>
	                    	<c:otherwise>未知</c:otherwise>
	                    </c:choose>
	                    </p>
	                </div>
	                <c:if test="${obj.valid == '00' && (obj.state == '00' || obj.state == '01') }">
		                <div align="right" style="width: 60px;">
		                    	<span href="javascript:;" onclick="applyOutCfm('${obj.relaId}');" class="weui_btn weui_btn_plain_primary weui_btn_mini ">退出</span>
		                </div>
	                </c:if>
	            </a>
        	</c:forEach>
        </div>
    </div>
</div>

<%@ include file="/pages/wx/page.jsp"%>

</form>
<div class="weui_tabbar" style="position: fixed;bottom: 0%;left: 0%;z-index: 0;background-color:#04BE02;">
    <a href="${urlBasePath}weixin/user/companySearch.do" class="weui_tabbar_item weui_bar_item_on">
        <p class="weui_tabbar_label" style="line-height: 40px;font-size:1.2em;color: #ffffff;">
        <i class="fa fa-search fa-sm"></i>&nbsp;搜索企业</p>
    </a>
</div>
<div style="height: 60px;display: block;"></div>

<div class="pop">
    <i class="fa fa-home fa-lg popi"></i>
</div>

<!-- 引入微信样式代码提示工具开始 -->
<%@ include file="/pages/wx/wxClass.jsp"%>
<!-- 引入微信样式代码提示工具结束 -->
<%@ include file="/pages/wx/baseBottom.jsp"%>
</body>
</html>

